﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Mindfor.Web.Config
{
	/// <summary>
	/// Represents user configuration section.
	/// </summary>
	public sealed class UserElement : ConfigurationElement
	{
		/// <summary>
		/// Gets or sets whether email should be approved before user can login. Default is true.
		/// </summary>
		[ConfigurationProperty("isEmailApproveRequired", DefaultValue = true)]
		public bool IsEmailApproveRequired
		{
			get { return (bool)this["isEmailApproveRequired"]; }
			set { this["isEmailApproveRequired"] = value; }
		}

		/// <summary>
		/// Gets or sets if e-mail is required field for user registration. Default is true.
		/// </summary>
		[ConfigurationProperty("isEmailRequired", DefaultValue = true)]
		public bool IsEmailRequired
		{
			get { return (bool)this["isEmailRequired"]; }
			set { this["isEmailRequired"] = value; }
		}

		/// <summary>
		/// Gets or sets authentication type. Default is Email.
		/// </summary>
		[ConfigurationProperty("authenticateBy", DefaultValue = AuthenticationType.Email)]
		public AuthenticationType AuthenticateBy
		{
			get { return (AuthenticationType)this["authenticateBy"]; }
			set { this["authenticateBy"] = value; }
		}
	}
}
